-
-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Clangd-wasm example, build LS images with GHA #734
Conversation
I did some investigation around clangd and the possibility to run it in the browser already, here's what I've found:
I was able to run a small C program compiled into wasm, properly accessing the VSCode virtual filesystem. But since it doesn't support some basic features like threads, it failed to run any "advanced" binaries The only option currently seems to be https://github.com/guyutongxue/clangd-in-browser, but I wonder if it's able to interact with the filesystem, and how? |
@CGNonofr Great, thanks for sharing 👍 If this becomes fully working in the browser at one point in time (via whatever tech) it will be awesome.
It brings its own virtual file system. You can read and write files (done here: https://github.com/TypeFox/monaco-languageclient/blob/clangd-example/packages/examples/src/clangd/worker/clangd-server.ts) |
Isn't there any way to provide our own implementation instead? which would access the VSCode filesystem? That would be a shame to have to watch the filesystem to register the files one by one |
The wasm already contains the header files meaning when you have it loaded you can read all the header files as far as I understand it. Something must be adjusted in the build process to change that, I guess. I did not investigate any of this so far. |
But now we can start to play with it and try things... |
e11ab45
to
6987fd3
Compare
6987fd3
to
6f804b7
Compare
@CGNonofr I will open up a second PR with the wrapper improvements and base this one on it. I need to fix some build problems first. |
0391847
to
5a9438b
Compare
ff7bd8e
to
a43b165
Compare
f599c58
to
2843ca9
Compare
f5ae2d7
to
fa127b8
Compare
fa127b8
to
88fc228
Compare
88fc228
to
b8df658
Compare
@CGNonofr maybe we should this merge at some, even if there are improvements required and improve it subsequently (file handling needs polishing and even some parts should be extracted out the examples. I have to make up my mind) The example should contain a sentence that this is still a prototype and the underlying code is still evolving. |
- Condense code - Make use of new wrapper features
- Increase clangd timeout to 150 minutes
64f9110
to
b1f96a6
Compare
- define file system endpoints - clangd LS uses message port for communication - Use wtm new ComChannelEndpoints for handling async communication of message channels or workers - worker transfers files to client via message channel - clangd example: list open files below editor - Prototype: File system related code added to monaco-languageclient/fs
b1f96a6
to
8531e4e
Compare
@CGNonofr this is ready for merge on my side. There will be improvements. |
@CGNonofr thank you. This is the most complex example to date with many different facets. It could also evolve to a more vscode like editor with explorer view by utilizing the views service. The opened file drop-down is just a simple hack for now. |
This PR adds the clangd wasm port from https://github.com/guyutongxue/clangd-in-browser into a new example. The client side of the example is already clean-up / aligned to the other example. TODO: The server side code needs some polishing.
In addition the following things have been added along:
Once we have clangd in integrated, we have together with pyright and eclispe.jdt.ls enough complex language server (worker and web socket conn.) available to integrate different ways of file synchronizations. This PR enables more future enhancements.